package model.entity.stats;

import java.util.List;
import utilities.*;

public class OffensiveRating extends DerivedStat implements Archiveable
{
	
	/**
	 * @param modifiers
	 * @param derivationValues
	 */
	public OffensiveRating(List<StatModifier> modifiers, List<Stat> derivationValues)
	{
		super(modifiers, derivationValues);
	}

	public OffensiveRating()
	{
		super();
	}

	@Override
	public double getValue()
	{
		double value = 0.0;
		
		for (Stat s: derivationValues)
		{
			if(s.getName().equals(StatType.STRENGTH))
			{
				value+= s.getValue()*5;
			}
		}
		
		for (StatModifier m : modifiers)
		{ //To apply all the modifiers
			value += m.getValue(value);
		}
	
		return value;
	}
	
	public Archive save() {
		Archive archive = super.save();
		
		return archive;
	}
	
	public void load(Archive archive) {
		super.load(archive);
	}

}
